import { PORT1 } from "@/api/config/servicePort";
import Http from "@/api/index";

const baseUrl = PORT1 + "/system/about";

const baseUrl1 = baseUrl + "/category";

const baseUrl2 = baseUrl + "/small_category";

const baseUrl3 = baseUrl + "/article";

export const createApi = (params: any) => {
  return Http.post(baseUrl1 + "/add", params);
};

export const editApi = (params: any) => {
  return Http.put(baseUrl1 + "/edit", params);
};

export const deleteApi = (params: any) => {
  return Http.post(baseUrl1 + "/delete", params);
};

export const getList = () => {
  return Http.get(baseUrl1 + "/list");
};

export const createSmallApi = (params: any) => {
  return Http.post(baseUrl2 + "/add", params);
};

export const editSmallApi = (params: any) => {
  return Http.put(baseUrl2 + "/edit", params);
};

export const deleteSmallApi = (params: any) => {
  return Http.post(baseUrl2 + "/delete", params);
};

export const getSmallList = (params: any) => {
  return Http.get(baseUrl2 + "/list", params);
};

export const createArt = (params: any) => {
  return Http.post(baseUrl3 + "/add", params);
};

export const editArt = (params: any) => {
  return Http.put(baseUrl3 + "/edit", params);
};

export const getArtList = (params: any) => {
  return Http.get(baseUrl3 + "/list", params);
};

export const getArtInfo = (params: any) => {
  return Http.get(baseUrl3 + "/info", params);
};

export const deleteArtApi = (params: any) => {
  return Http.post(baseUrl3 + "/delete", params);
};
